package com.kaifamiao.www.demo.Do18;

import java.util.Scanner;

public class Ex03 {
    public static void main(String[] args) {

        System.out.println("请输入阶乘的数字");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        //！n=n*(n-1)*(n-2)*(n-3).....*3*2*1也就是！n = 1*2*3......*(n-1)*n
        int sum = 1;
       for( int i = 1;i <= n;i++){
           sum*=i;
       }
        System.out.println("sum="+sum);
    }
}
